package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysLeave;
import com.bohua.intermediary.service.SysLeaveService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysLeave")
public class SysLeaveController {
    @Resource
    private SysLeaveService sysLeaveService;

    @RequestMapping
    public String sysLeave(){
        return "sysLeave/sysLeave";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysLeave/addSysLeave";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysLeave/updateSysLeave";
    }

    @RequestMapping("/getSysLeaves")
    @ResponseBody
    public Lay getSysLeaves(SysLeave sysLeave,Integer page,Integer limit){
        return sysLeaveService.getSysLeaves(sysLeave,page,limit);
    }
    @RequestMapping("/addSysLeave")
    @ResponseBody
    public Msg addSysLeave(SysLeave sysLeave){
        return sysLeaveService.addSysLeave(sysLeave);
    }

    @RequestMapping("/updateSysLeave")
    @ResponseBody
    public Msg updateSysLeave(SysLeave sysLeave){
        return sysLeaveService.updateSysLeave(sysLeave);
    }

    @RequestMapping("/delSysLeave")
    @ResponseBody
    public Msg delSysLeave(SysLeave sysLeave){
        return sysLeaveService.delSysLeave(sysLeave);
    }
}
